
message("---xcmake[import_lua]: liblua")




find_library(LIBLUA_LIBS
    NAMES lua
    PATHS
        ${CMAKE_SOURCE_DIR}/third_part/prebuild/mac/lua/lib
    NO_DEFAULT_PATH  # 不搜默认路径
)

if (NOT LIBLUA_LIBS)
    MESSAGE("liblua is not found: saerch_path=" ${CMAKE_CURRENT_SOURCE_DIR}/third_part/prebuild/mac/lua/lib)
    return()
endif()

find_path(LIBLUA_INC_DIRS
    NAMES lua.h
    PATHS
        ${CMAKE_CURRENT_SOURCE_DIR}/third_part/prebuild/mac/lua/include
    NO_DEFAULT_PATH
)

if (NOT LIBLUA_LIBS)
    MESSAGE("lua.h is not found: saerch_path=" ${CMAKE_CURRENT_SOURCE_DIR}/third_part/prebuild/mac/lua/lib)
    return()
endif()

add_library(liblua STATIC IMPORTED)
set_target_properties(liblua PROPERTIES
IMPORTED_IMPLIB LIBLUA_LIBS
)

message("---xcmake[import_lua]: libs=${LIBLUA_LIBS}")
message("---xcmake[import_lua]: inc_dirs=${LIBLUA_INC_DIRS}")